home *** CD-ROM | disk | FTP | other *** search
- Path: howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!usenet
- From: grantp@usa.pipeline.com(Pete Grant)
- Newsgroups: comp.lang.c++
- Subject: Re: Can't compile template class with g++
- Date: 23 Mar 1996 03:43:43 GMT
- Organization: Pipeline USA
- Message-ID: <4ivs1f$30h@news1.h1.usa.pipeline.com>
- References: <31534476.1A120953@henson.cc.wwu.edu>
- NNTP-Posting-Host: 38.8.61.11
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete Grant)
- X-Newsreader: Pipeline v3.5.0
-
- On Mar 22, 1996 16:23:18 in article <Can't compile template class with
- g++>, 'Kiet Lam <n9448673@henson.cc.wwu.edu>' wrote:
-
-
- >I am having problem compiling the following codes under Linux 1.2.8
- >with g++ compiler.
- >
- >template <class ET> class CTemplate {
- >public:
- >CTemplate(ET Init);
- >void Show(void);
- >protected:
- >private:
- >ET InitValue;
- >};
- >
- template<class ET> ////// You needs this...
- >CTemplate<ET>::CTemplate(ET Init) { //compiler complains at this line
- and this ... ^^^^^
- >InitValue = Init;
- >}
- >
-
- >void CTemplate::Show(void) { //compiler complains at this line too
- >cout << "InitValue = " << InitValue << endl;
- >}
- See above. Needs same fixes.
-
- --
-
- Pete Grant
- Kalevi, Inc.
- Sofware Engineering
-